#pragma once
#include <memory>
#include <vector>
#include <utility>
#include "../../camera/camera.hpp"
#include "../engine/engine.hpp"
#include "../../graphics/shader.hpp"
#include "../../graphics/texture.hpp"
#include "../../graphics/mesh.hpp"
#include "../../voxel/voxelchunks.hpp"

namespace vx
{
    class GameEngine : public Engine
    {
    public:
        GameEngine(const std::string& windowTitle);
        virtual ~GameEngine();

        virtual void onStart();
        virtual void onUpdate();
        virtual void onRender();

    private:
        std::shared_ptr<Camera> _camera = nullptr;

        GLuint _VAO, _VBO;
        std::shared_ptr<Shader> _shader = nullptr;
        std::shared_ptr<Texture> _texture = nullptr;

        std::shared_ptr<VoxelChunks> _chunks = nullptr;
        std::vector<std::pair<VoxelChunk*, std::shared_ptr<Mesh>>> _chunkMeshes;

        std::shared_ptr<Shader> _lineShader = nullptr;
    };
}
